from django.contrib.auth.models import Permission #权限
from rest_framework.permissions import DjangoModelPermissions, IsAdminUser
from rest_framework.viewsets import ModelViewSet
from apps.wthg_admin.serializers.permission import PermissionModelSerializer
from apps.wthg_admin.utils import UtilsPageNumberPagination
from django.contrib.auth.models import ContentType
from apps.wthg_admin.serializers.permission import ContentTypeModelSerializer
from rest_framework.generics import ListAPIView

class PermissionModelViewSet(ModelViewSet):
    """权限表管理"""
    queryset = Permission.objects.all()
    serializer_class = PermissionModelSerializer
    pagination_class = UtilsPageNumberPagination



class ContentTypeListAPIView(ListAPIView):
    """权限类型表查询"""
    queryset=ContentType.objects.all()
    serializer_class = ContentTypeModelSerializer

